<script>
	$(function() {
		$( "#txtNgaybatdau" ).datepicker();
		
		tinyMCE.init({
        // General options
        mode : "exact",
		elements : "mtxNoidung",
        theme : "advanced",
        plugins : "autolink,lists,table,save,advimage,advlink,inlinepopups,insertdatetime,preview,searchreplace,print,contextmenu,paste,directionality,fullscreen",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,cite,abbr,acronym,del,ins,attribs,visualchars,nonbreaking,template,blockquote,pagebreak,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Skin options
        skin : "o2k7",
        skin_variant : "silver",

        // Example content CSS (should be your site CSS)
        content_css : "css/example.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "js/template_list.js",
        external_link_list_url : "js/link_list.js",
        external_image_list_url : "js/image_list.js",
        media_external_list_url : "js/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
                username : "Some User",
                staffid : "991234"
        }
});

	});
</script>
<script>
	$(function() {
		$( "#txtNgayketthuc" ).datepicker();
	});
</script>

<?php
if (!defined('WEB_ROOT')) {
	exit;
}

$nn_id = (isset($_GET['nn_id']) && $_GET['nn_id'] > 0) ? $_GET['nn_id'] : 0;

$topicGroupList = buildTopicGroupOptions($nn_id);
?> 
<br />
<form action="processTopic.php?action=addTopic" method="post" enctype="multipart/form-data" name="frmAddTopic" id="frmAddTopic">
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="entryTable">
  <tr><td colspan="6" id="entryTableHeader">Thêm đề tài</td></tr>

  <tr> 
	   <td width="150" class="label">Mã đề tài</td>
	   <td colspan="5" class="content"> <input name="txtMadt" type="text" class="box" id="txtMadt" size="20" maxlength="20"></td>
  </tr>
  <tr> 
	   <td width="150" class="label">Tên đề tài</td>
	   <td colspan="5" class="content"> <textarea name="mtxTendt" cols="80" rows="2" class="box" id="mtxTendt"></textarea></td>
  </tr>
  <tr> 
	   <td width="150" class="label">Tóm tắt đề tài</td>
	   <td colspan="5" class="content"> <textarea name="mtxTomtat" mce_editable="false" cols="80" rows="4" class="box" id="mtxTomtat"></textarea></td>
  </tr>
  <tr> 
	   <td width="150" class="label">Nội dung đề tài</td>
	   <td colspan="5" class="content"> <textarea name="mtxNoidung" mce_editable="true" cols="80" rows="15" class="box" id="mtxNoidung"></textarea></td>
  </tr>
  <tr> 
	   <td width="150" class="label">Ngày bắt đầu</td>
	   <td width="150" class="content"><input name="txtNgaybatdau" type="text" id="txtNgaysbatdau" size="10" maxlength="10" class="box"> </td>
       <td width="150" class="label">Ngày kết thúc </td>
       <td width="150" class="content"><input name="txtNgayketthuc" type="text" id="txtNgayketthuc" size="10" maxlength="10" class="box" /></td>
       <td width="150" class="label">Trạng thái </td><td class="content"><input name="txtTrangthai" type="text" id="txtTrangthai" size="20" maxlength="20" class="box" /></td>
  </tr>
  <tr> 
	   <td width="150" class="label">Nhóm ngành</td>
	   <td colspan="3" class="content"> <select name="cboTopicGroup" id="cboTopicGroup" class="box">
		<option value="" selected>-- Chọn nhóm ngành --</option>
			<?php
				echo $topicGroupList;
			?>	 
		</select></td>
       <td class="label">Đơn vị</span></td>
       <td class="content"><input name="txtDonvi" type="text" id="txtDonvi" size="40" maxlength="40" class="box" /></td>
  </tr>
  <tr><td colspan="6" id="entryTableHeader">Người thực hiện đề tài</td></tr>
 </table>
 <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="text">
	  <tr align="center" id="listTableHeader">
	  	 <td width="180">Tên người thực hiện</td>
		   <td width="100">Vai trò</td>
		   <td width="80">Sửa</td>
		   <td width="80">Xóa</td>
	 </tr>

	
  </table>
 <p align="center"> 
  <input name="btnAddTopic" type="button" id="btnAddTopic" value="Thêm đề tài" onClick="checkAddTopicForm();" class="box">
  &nbsp;&nbsp;<input name="btnCancel" type="button" id="btnCancel" value=" Hủy " onClick="window.location.href='index.php';" class="box">  
 </p>
</form>
